/**
 * 相似的前提是它们都含有相同数目的 元音(aeiou)
 * @param {string} s 
 * @returns 
 * s长度为偶数 由大写和小写字母组成 平分为前后两段
 */
var halvesAreAlike = function (s) {
    s = s.toLowerCase()
    let front = s.slice(0, s.length / 2),
        back = s.slice(s.length / 2, s.length),
        frontCount = 0,
        backCount = 0
    const vowel = "aeiou"
    for (let i = 0; i < s.length / 2; i++) {
        let frontLetter = front[i],
            backLetter = back[i]
        if (vowel.indexOf(frontLetter) != -1) {
            frontCount++
        }
        if (vowel.indexOf(backLetter) != -1) {
            backCount++
        }
    }
    return frontCount == backCount
};